@extends('mobile_end.layouts.default')
{{-- content_header --}}

@section('container')

<div id="slider">
    @foreach($top_entries as $entry)
    @if($entry->thumbs->count()>0)
    <div>
        <a href="{{ URL::action('MobileFoodController@getDetail', $entry->id) }}">
            <img src="{{ URL::to('file/image_crop/16/9/480?name=').(($entry->thumbs->count()>0) ? $entry->thumbs->first()->path : 'default_food.jpg') }}">
        </a>
        <p>今日推荐: {{$entry->name}}</p>
    </div>
    @endif
    @endforeach
</div>
<div class="bgstyle indexsub">
    <ul style="text-align:center;">
        <li class="s1 bg1"><a href="{{ URL::to('mobile_end/foods/index') }}" class="button button-circle button-flat-action"><i class="icon-food icon-large"></i> 我要订餐</a> </li>
        @if($order)
        <li class="s2 bg2"><a href="{{ URL::action('MobileOrderController@getDetail', $order->id) }}" class="button button-circle button-flat-highlight"><i class="icon-qrcode icon-large"></i> 我要打票</a> </li>
        @else
        <li class="s2 bg2"><a href="{{ URL::to('mobile_end/baskets/index') }}" class="button button-circle button-flat-highlight"><i class="icon-qrcode icon-large"></i> 购物车</a> </li>
        @endif
    </ul>
</div>
<ul class="data-list">
    @foreach($entries as $entry)
    @include('mobile_end.layouts._food_list_li', array('entry'=>$entry))
    @endforeach
</ul>

@stop

@section('scripts')

<script>
    //创建slider组件
    $('#slider').slider( { imgZoom: true });
    try{
        @if(isset($user))
        window.web.rememberKey("{{ $user }}", "{{ $auth }}");
        @endif
    }catch (e){

    }
    
    //plus事件处理
    if(window.plus){
        plusReady();
    }else{
        document.addEventListener("plusready",plusReady,false);
    }
  
    function plusReady(){
        // 关闭程序启动界面
        plus.navigator.closeSplashscreen();
    }
</script>

@stop